

import request from '@/utils/request'

export default {
    //获取教育头条分页列表
    getHeadlineShowListPage(page, headlineShowQuery, status) {
        return request({
            url: `/headline/selectByscreen`,
            method: 'post',
            data: {
                page: page,
                name: headlineShowQuery.name,
                upTime: headlineShowQuery.startTime,
                timeLimit: headlineShowQuery.endTime,
                status: status
            }
        })
    },
    //移除教育头条到回收站或者删除
    deleteOne(id) {
        return request({
            url: `/headline/deleteOne?id=${id}`,
            method: 'get'
        })
    },
    thoroughDelete(id) {
        return request({
            url: `/headline/thoroughDelete?id=${id}`,
            method: 'get'
        })
    },
    recoverOne(id) {
        return request({
            url: `/headline/recoverOne?id=${id}`,
            method: 'get'
        })
    },
    //添加教育头条
    addHeadLine(headLineEntity) {
        return request({
            url: `/headline/addOne`,
            method: 'post',
            data: {
                id: headLineEntity.id,
                name: headLineEntity.name,
                pic: headLineEntity.pic,
                decreption: headLineEntity.decreption,
                emplId: headLineEntity.sortId,
                sortId: headLineEntity.sortId,
            }
        })
    },
    //根据id查询教育头条
    getHeadlineShow(id) {
        return request({
            url: `/headline/selectOne?id=${id}`,
            method: 'get'
        })
    },
    //修改教育头条
    updateHeadLine(headLineEntity) {
        return request({
            url: `/headline/updateOne`,
            method: 'post',
            data: headLineEntity
        })
    },
    //批量删除教育头条
    deleteBatchesById(id) {
        return request({
            url: `/headline/deleteBatches`,
            method: 'post',
            data: { ids: id }
        })
    }

}